package com.itheima.Method;

public class Chant {
    public static void main(String[] args) {
int arr[]= {11,22,33,44,55};
exchange(arr,2,4);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
    public static void exchange(int arr[],int index1,int index2){
        int temp = arr[index1];
     arr[index1] = arr[index2];
     arr[index2] = temp;

    }
}

